import request from '@/utils/request'

// 获取  spu 列表
export const getSpuListApi = (page, limit, category3Id) => {
  return request.get(`/admin/product/${page}/${limit}?category3Id=${category3Id}`)
}

// 添加spu
export const saveSpuInfoApi = (spuInfo) => {
  return request.post(`/admin/product/saveSpuInfo`, spuInfo)
}

// 获取品牌列表
export const getTmListApi = () => {
  return request.get(`/admin/product/baseTrademark/getTrademarkList`)
}

// 获取基本销售属性
export const getBaseSaleAttrListApi = () => {
  return request.get(`/admin/product/baseSaleAttrList`)
}
// 添加spu
export const addSpuInfoApi = (data) => {
  return request.post(`/admin/product/saveSpuInfo`, data)
}
// 获取spu 的基本信息
export const getSpuApi = (spuId) => {
  return request.get(`/admin/product/getSpuById/${spuId}`)
}
// 根据spuId 获取 spu的图片
export const getSpuImageListApi = (spuId) => {
  return request.get(`/admin/product/spuImageList/${spuId}`)
}
// 根据spuId 获取 spu的销售属性
export const getSpuSaleAttrListApi = (spuId) => {
  return request.get(`/admin/product/spuSaleAttrList/${spuId}`)
}
// 更改spu信息
export const updateSpuInfoApi = (data) => {
  return request.post(`/admin/product/updateSpuInfo`, data)
}
// 删除spu
export const deleteSpuApi = (spuId) => {
  return request.delete(`/admin/product/deleteSpu/${spuId}`)
}
